<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<meta property="wb:webmaster" content="f5fa86834d69ff82" />
<meta name="baidu-site-verification" content="mJjNqGLcBkuiefSg" />
<title>如何使用C++开发PHP扩展（上） - WiFeng的博客</title>

<!-- 使用url函数转换相关路径 -->

<link rel="stylesheet" type="text/css" media="all" href="http://521-wf.com/usr/themes/Dispatch/style.css" />

<link rel="stylesheet" type="text/css" media="all" href="http://521-wf.com/usr/themes/Dispatch/personal.css" />

<!-- 通过自有函数输出HTML头部信息 -->
<meta name="description" content="目前，PHP编程语言也是相当成熟，各种文档，各种问题，只要Google一下，总有你想要的答案。当然“如何开发PHP扩展”的文章也不少，但是很少有专门来介绍使用C++开发PHP扩展的介绍。C++编程语言..." />
<meta name="keywords" content="扩展" />
<meta name="generator" content="Typecho 0.8/10.8.15" />
<meta name="template" content="Dispatch" />
<link rel="pingback" href="http://521-wf.com/action/xmlrpc" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://521-wf.com/action/xmlrpc?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://521-wf.com/action/xmlrpc?wlw" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://521-wf.com/feed/archives/241.html" />
<link rel="alternate" type="application/rdf+xml" title="RSS 1.0" href="http://521-wf.com/feed/rss/archives/241.html" />
<link rel="alternate" type="application/atom+xml" title="ATOM 1.0" href="http://521-wf.com/feed/atom/archives/241.html" />
<script type="text/javascript">
//<![CDATA[
var TypechoComment = {
    dom : function (id) {
        return document.getElementById(id);
    },
    
    create : function (tag, attr) {
        var el = document.createElement(tag);
        
        for (var key in attr) {
            el.setAttribute(key, attr[key]);
        }
        
        return el;
    },

    reply : function (cid, coid) {
        var comment = this.dom(cid), parent = comment.parentNode,
            response = this.dom('respond-post-241'), input = this.dom('comment-parent'),
            form = 'form' == response.tagName ? response : response.getElementsByTagName('form')[0],
            textarea = response.getElementsByTagName('textarea')[0];

        if (null == input) {
            input = this.create('input', {
                'type' : 'hidden',
                'name' : 'parent',
                'id'   : 'comment-parent'
            });

            form.appendChild(input);
        }
        
        input.setAttribute('value', coid);

        if (null == this.dom('comment-form-place-holder')) {
            var holder = this.create('div', {
                'id' : 'comment-form-place-holder'
            });
            
            response.parentNode.insertBefore(holder, response);
        }

        comment.appendChild(response);
        this.dom('cancel-comment-reply-link').style.display = '';
        
        if (null != textarea && 'text' == textarea.name) {
            textarea.focus();
        }
        
        return false;
    },

    cancelReply : function () {
        var response = this.dom('respond-post-241'),
        holder = this.dom('comment-form-place-holder'), input = this.dom('comment-parent');

        if (null != input) {
            input.parentNode.removeChild(input);
        }

        if (null == holder) {
            return true;
        }

        this.dom('cancel-comment-reply-link').style.display = 'none';
        holder.parentNode.insertBefore(response, holder);
        return false;
    }
}
//]]>
</script>
<link rel="stylesheet" type="text/css" media="all" href="http://521-wf.com/usr/themes/Dispatch/desert.css" />
<link rel="stylesheet" type="text/css" media="all" href="http://521-wf.com/usr/themes/Dispatch/style.css" />
</head>

<body class="home blog">
	<div id="wrapper" class="clearfix">
		<div class="top-bar">
			<div class="frame">
				<div class="frame-inside">
					<!-- header navigation menu -->
					<div class="menu-templatemenu-container"><ul id="menu-templatemenu" class="nav">
					<li class="current menu-item menu-item-type-taxonomy menu-item-object-category"><a href="http://521-wf.com/">首页</a></li>
					                <li class="current menu-item menu-item-type-taxonomy menu-item-object-category"><a href="http://521-wf.com/category/cpp/">C/C++</a></li>
<li class="current menu-item menu-item-type-taxonomy menu-item-object-category"><a href="http://521-wf.com/category/mobile/">Mobile</a></li>
<li class="current menu-item menu-item-type-taxonomy menu-item-object-category"><a href="http://521-wf.com/category/web/">Web</a></li>
<li class="current menu-item menu-item-type-taxonomy menu-item-object-category"><a href="http://521-wf.com/category/asset/">Asset</a></li>
<li class="current menu-item menu-item-type-taxonomy menu-item-object-category"><a href="http://521-wf.com/category/datax/">DataX</a></li>
<li class="current menu-item menu-item-type-taxonomy menu-item-object-category"><a href="http://521-wf.com/category/jottings/">Jotting</a></li>
    
</div>					
					<!-- social icons -->

					<div id="social-strip-icons">
																
											</div>
					
											<!-- If it's the main page, category, or search page show the sorting drop menu. -->
						<ul class="nav filter-list filter">
							<li class="sort-posts all-projects"><a href="#wrapper">回到顶部</a>
							</li>
						</ul><!-- filter list -->
									</div><!-- frame inside -->
			</div><!-- frame -->
		</div><!-- top bar -->
		
		<div style="clear:both;"></div><div class="clearfix" id="main">
<div class="clearfix" id="sidebar-wrap">
				<div id="sidebar">				
					
					<!-- grab the logo -->
							            	<h1>
							<a href="http://521-wf.com/">
       <img alt="WiFeng的个人博客， 热衷于技术探讨和分享。知识在于积累，人生在于总结。让我们共同创造美好的未来，让互联网继续改善我们的生活。" src="http://521-wf.com/usr/themes/Dispatch/images/logo.jpg" class="logo" width="180" height="180"></a>
						</h1>
					
					<!-- otherwise show the site title and description -->	
		            	
					<!-- grab sidebar widgets -->				
					<div class="widget last-sidebar"><h2 class="widgettitle">搜索</h2>
<form class="search-form clearfix" action="/">
	<fieldset>
		<input type="text" value="search the site" onblur="if (this.value == '') {this.value = 'search the site';}" onfocus="if (this.value == 'search the site') {this.value = '';}"  name="s" class="search-form-input text">
		<input type="submit" class="submit" value="Go">
	</fieldset>
</form></div>

<div class="widget last-sidebar"><h2 class="widgettitle">最近回复</h2>
			<ul>
                            <li><a href="http://521-wf.com/archives/46.html/comment-page-1#comment-2629">WiFeng</a>: 上面文章的意思是说如果现有的模块满足不了你的需要的话，可以新加代码来支持实现；不过你可以现有的模块设...</li>
                            <li><a href="http://521-wf.com/archives/46.html/comment-page-1#comment-2569">HuarenKids</a>: 菜鸟请求帮助。能给出详细的例子么？我想在门户DIY调用除了某个用户之外，其他用的日志。我在templ...</li>
                            <li><a href="http://521-wf.com/friendlylink.htm/comment-page-1#comment-2509">WiFeng</a>: 之前是你给我发过邮件吧？</li>
                            <li><a href="http://521-wf.com/archives/258.html/comment-page-1#comment-2508">WiFeng</a>: 你想实现什么效果？</li>
                            <li><a href="http://521-wf.com/friendlylink.htm/comment-page-1#comment-2505">lilei</a>: 从自由风格插件找到你的，想你请教学习啦！插件很强大，但我还没弄好。</li>
                            <li><a href="http://521-wf.com/archives/258.html/comment-page-1#comment-2503">222</a>: Discuz! 自由风格插件  是不是不能使用了  怎么实现不 了呢</li>
                            <li><a href="http://521-wf.com/archives/36.html/comment-page-1#comment-2446">sealinger</a>: 已登录用户，即便验证码输入错误，也可以提交评论（Typecho 1.0）。
是菜单吗？ :-)</li>
                            <li><a href="http://521-wf.com/archives/36.html/comment-page-1#comment-2445">sealinger</a>: 感谢提供解决方法！</li>
                            <li><a href="http://521-wf.com/archives/41.html/comment-page-1#comment-2421">南笙</a>: 插件引起博客加载过慢http://blog.rori.tv/</li>
                            <li><a href="http://521-wf.com/archives/36.html/comment-page-1#comment-2390">啸傲居士</a>: 汗，找到问题原因了。是session没有开启的原因，只需要在config.inc.php文件“Typ...</li>
                        </ul>
</div>

<div class="widget last-sidebar"><h2 class="widgettitle">分类</h2>
			<ul>
                <li><a href="http://521-wf.com/category/cpp/">C/C++</a> (6)</li>
<li><a href="http://521-wf.com/category/mobile/">Mobile</a> (2)</li>
<li><a href="http://521-wf.com/category/web/">Web</a> (73)</li>
<li><a href="http://521-wf.com/category/asset/">Asset</a> (16)</li>
<li><a href="http://521-wf.com/category/datax/">DataX</a> (1)</li>
<li><a href="http://521-wf.com/category/jottings/">Jotting</a> (14)</li>
            </ul>
</div>

<div class="widget last-sidebar"><h2 class="widgettitle">归档</h2>
			<ul>
                <li><a href="http://521-wf.com/2015/08/">August 2015</a></li>
<li><a href="http://521-wf.com/2015/03/">March 2015</a></li>
<li><a href="http://521-wf.com/2015/02/">February 2015</a></li>
<li><a href="http://521-wf.com/2015/01/">January 2015</a></li>
<li><a href="http://521-wf.com/2014/10/">October 2014</a></li>
<li><a href="http://521-wf.com/2014/07/">July 2014</a></li>
<li><a href="http://521-wf.com/2014/03/">March 2014</a></li>
<li><a href="http://521-wf.com/2014/01/">January 2014</a></li>
<li><a href="http://521-wf.com/2013/12/">December 2013</a></li>
<li><a href="http://521-wf.com/2013/11/">November 2013</a></li>
<li><a href="http://521-wf.com/2013/09/">September 2013</a></li>
<li><a href="http://521-wf.com/2013/08/">August 2013</a></li>
<li><a href="http://521-wf.com/2013/05/">May 2013</a></li>
<li><a href="http://521-wf.com/2013/03/">March 2013</a></li>
<li><a href="http://521-wf.com/2013/02/">February 2013</a></li>
<li><a href="http://521-wf.com/2012/12/">December 2012</a></li>
<li><a href="http://521-wf.com/2012/11/">November 2012</a></li>
<li><a href="http://521-wf.com/2012/10/">October 2012</a></li>
<li><a href="http://521-wf.com/2012/09/">September 2012</a></li>
<li><a href="http://521-wf.com/2012/08/">August 2012</a></li>
<li><a href="http://521-wf.com/2012/07/">July 2012</a></li>
<li><a href="http://521-wf.com/2012/06/">June 2012</a></li>
<li><a href="http://521-wf.com/2012/05/">May 2012</a></li>
<li><a href="http://521-wf.com/2012/04/">April 2012</a></li>
<li><a href="http://521-wf.com/2012/03/">March 2012</a></li>
<li><a href="http://521-wf.com/2012/02/">February 2012</a></li>
<li><a href="http://521-wf.com/2011/11/">November 2011</a></li>
<li><a href="http://521-wf.com/2011/05/">May 2011</a></li>
<li><a href="http://521-wf.com/2011/04/">April 2011</a></li>
<li><a href="http://521-wf.com/2011/03/">March 2011</a></li>
<li><a href="http://521-wf.com/2011/02/">February 2011</a></li>
<li><a href="http://521-wf.com/2010/10/">October 2010</a></li>
<li><a href="http://521-wf.com/2010/09/">September 2010</a></li>
<li><a href="http://521-wf.com/2010/05/">May 2010</a></li>
<li><a href="http://521-wf.com/2010/03/">March 2010</a></li>
<li><a href="http://521-wf.com/2010/02/">February 2010</a></li>
<li><a href="http://521-wf.com/2008/03/">March 2008</a></li>
<li><a href="http://521-wf.com/2008/02/">February 2008</a></li>
<li><a href="http://521-wf.com/2007/07/">July 2007</a></li>
            </ul>
</div>



				</div><!--sidebar-->
				
				<div style="clear: both;"></div>
	
				<!-- grab the sticky sidebar on the main blog pages, hide it on inside pages -->
				
					<div class="clearfix" id="stickyWrapper" style="height: 444px; width: 200px;"><div class="clearfix" id="sticky">
													<h2 class="sticky-title">关键词更懂你</h2>
												
						<div class="widget last-sidebar">
<div class="tagcloud">
     
      
          
     <a class="tag-link" href="http://521-wf.com/tag/%E6%8F%92%E4%BB%B6/" alt="插件" title="6 个话题" />     
          插件</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/Discuz/" alt="Discuz" title="6 个话题" />     
          Discuz</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/typecho/" alt="typecho" title="4 个话题" />     
          typecho</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/js/" alt="js" title="4 个话题" />     
          js</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E6%89%A9%E5%B1%95/" alt="扩展" title="4 个话题" />     
          扩展</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/php/" alt="php" title="3 个话题" />     
          php</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/shell/" alt="shell" title="3 个话题" />     
          shell</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E6%80%A7%E8%83%BD/" alt="性能" title="3 个话题" />     
          性能</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E5%9B%BE%E7%89%87/" alt="图片" title="2 个话题" />     
          图片</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/rz/" alt="rz" title="2 个话题" />     
          rz</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/sz/" alt="sz" title="2 个话题" />     
          sz</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/ssh/" alt="ssh" title="2 个话题" />     
          ssh</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E5%AF%B9%E8%B1%A1/" alt="对象" title="1 个话题" />     
          对象</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E8%99%9A%E6%8B%9F%E4%B8%BB%E6%9C%BA/" alt="虚拟主机" title="1 个话题" />     
          虚拟主机</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E5%8F%82%E6%95%B0/" alt="参数" title="1 个话题" />     
          参数</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/whois/" alt="whois" title="1 个话题" />     
          whois</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E5%9F%9F%E5%90%8D/" alt="域名" title="1 个话题" />     
          域名</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/apache/" alt="apache" title="1 个话题" />     
          apache</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/ZendFramework/" alt="ZendFramework" title="1 个话题" />     
          ZendFramework</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E5%B1%9E%E6%80%A7/" alt="属性" title="1 个话题" />     
          属性</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/https/" alt="https" title="1 个话题" />     
          https</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E9%85%8D%E7%BD%AE/" alt="配置" title="1 个话题" />     
          配置</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/include/" alt="include" title="1 个话题" />     
          include</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/require/" alt="require" title="1 个话题" />     
          require</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/access/" alt="access" title="1 个话题" />     
          access</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E7%AD%89%E6%AF%94%E6%98%BE%E7%A4%BA/" alt="等比显示" title="1 个话题" />     
          等比显示</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/clone/" alt="clone" title="1 个话题" />     
          clone</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E8%BF%90%E7%AE%97%E7%AC%A6/" alt="运算符" title="1 个话题" />     
          运算符</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E9%AA%8C%E8%AF%81%E7%A0%81/" alt="验证码" title="1 个话题" />     
          验证码</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/kindeditor/" alt="kindeditor" title="1 个话题" />     
          kindeditor</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/onload/" alt="onload" title="1 个话题" />     
          onload</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E7%BF%BB%E5%A2%99/" alt="翻墙" title="1 个话题" />     
          翻墙</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/goagent/" alt="goagent" title="1 个话题" />     
          goagent</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E5%AD%97%E6%AE%B5/" alt="字段" title="1 个话题" />     
          字段</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E9%80%9A%E7%9F%A5/" alt="通知" title="1 个话题" />     
          通知</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E5%86%85%E5%AD%98/" alt="内存" title="1 个话题" />     
          内存</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/fopen/" alt="fopen" title="1 个话题" />     
          fopen</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E6%94%BE%E5%BC%83/" alt="放弃" title="1 个话题" />     
          放弃</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/explain/" alt="explain" title="1 个话题" />     
          explain</a>
          
     <a class="tag-link" href="http://521-wf.com/tag/%E5%91%BD%E8%BF%90/" alt="命运" title="1 个话题" />     
          命运</a>
          
    
</div>
</div>					</div></div><!-- sticky -->
				
								
			</div>
<div class="filter-posts" id="content">
				<!-- grab the posts -->
	<div class="post-241 post clearfix project" data-id="post-241">
					<div class="box">
						<div class="shadow clearfix">
							<div class="frame">
								<h1 class="entry-title"><a href="http://521-wf.com/archives/241.html">如何使用C++开发PHP扩展（上）</a></h1>
<p>
	目前，PHP编程语言也是相当成熟，各种文档，各种问题，只要Google一下，总有你想要的答案。当然“如何开发PHP扩展”的文章也不少，但是很少有专门来介绍使用C++开发PHP扩展的介绍。C++编程语言功能的强大，促使好多公司后台程序选择使用它，因此碰到的大多数情况是需要我们用C++来扩展 PHP。PHP源码中的扩展骨架工具，默认生成的是支持 C 语言，如果要使用C++开发，有些参数需要另行配置。下面将用一个简单的示例来说明。 
</p>
<!--more-->
<p>
	<strong>准备工作：</strong> 
</p>
<p>
	1. 下载PHP源码&nbsp;http://www.php.net/downloads，这里下载到的是&nbsp;php-5.3.24.tar.gz<br />
2. 解压后，源码放到&nbsp;/root/php-5.3.24/<br />
3. 安装目录：/usr/local/php-5.3.24/<br />
4. 开始安装，配置 php.ini 的路径，方便以后进行个性化配置<br />
5. 扩展名称：discuz<br />
6. 扩展函数：discuz_say()，这个函数只返回一个“Hello world!” 字符串<br />
7. 扩展可运行在 win32 系统，也运行在类unix系统，但是需要编译不同的文件，这里只介绍　GNU/Linux 下的操作。
</p>
<p>
	<strong>开始编写扩展：</strong> 
</p>
<p>
	1. 创建要实现的函数列表文件 discuz.proto，内容如下：
</p>
<pre class="prettyprint lang-bsh">string discuz_say()</pre>
<p>
	2. 使用扩展骨架工具生成核心文件，命令如下：
</p>
<pre class="prettyprint lang-bsh">[root@localhost ~]# cd php-5.3.24/ext/
[root@localhost ext]# ./ext_skel --extname=discuz --proto=../../discuz.proto</pre>
<p>
	这时就在 ext 目录下出现了 discuz 文件夹，里面包含几个文件，如：config.m4&nbsp;discuz.c &nbsp;php_discuz.h 等等。
</p>
<p>
	3. 修改config.m4文件，内容如下：
</p>
<pre class="prettyprint lang-bsh">dnl $Id$
dnl config.m4 for extension discuz

PHP_ARG_ENABLE(discuz, whether to enable discuz support,
Make sure that the comment is aligned:
[  --enable-discuz           Enable discuz support])

if test "$PHP_DISCUZ" != "no"; then
  PHP_REQUIRE_CXX()    dnl 通知Make使用g++
  PHP_ADD_LIBRARY(stdc++, 1, EXTRA_LDFLAGS)    dnl 加入C++标准库

  PHP_NEW_EXTENSION(discuz, discuz.cpp, $ext_shared)
fi</pre>
<p>
	这个文件中&nbsp;dnl 是注释符，其之后的字串是解释上下文。
</p>
<p>
	<span style="line-height:1.5;"> 4. 修改&nbsp;discuz.c 文件重名为 discuz.cpp（这样命名看起来更专业）</span> 
</p>
<p>
	4.1 加入需要的C++ string 头文件，如下：
</p>
<pre class="prettyprint lang-cpp">#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_discuz.h"

#include &lt;string&gt;   /* 添加这行 */</pre>
<p>
	4.2 修改 discuz_say 函数，如下：
</p>
<pre class="prettyprint lang-cpp">/* {{{ proto string discuz_say()
    */
PHP_FUNCTION(discuz_say)
{
    std::string str = "Hello world!";
    RETURN_STRINGL(str.c_str(), str.length(), 1);
}</pre>
<p>
	<span style="line-height:1.5;">5. 编译扩展，把其 discuz.so 放到安装目录（可以参考&nbsp;</span><span style="line-height:1.5;"></span><span style="line-height:1.5;"><a href="http://521-wf.com/archives/227.html" target="_blank">编译PHP扩展的两种方式</a>）。</span> 
</p>
<p>
	<strong>开始测试：</strong> 
</p>
<pre class="prettyprint lang-php">&lt;?php
echo discuz_say() . "\n";
?&gt;</pre>
<pre class="prettyprint lang-bsh">[root@localhost ~]# /usr/local/php-5.3.24/bin/php hi.php 
Hello world!</pre>
到此，一个简单的扩展就完成了。更多参考：<a href="http://www.php.net/manual/zh/internals2.buildsys.php" target="_blank">PHP 5 构建系统<br />
</a><br />
			<p class="tags">标签: <a href="http://521-wf.com/tag/%E6%89%A9%E5%B1%95/">扩展</a></p>

							</div><!-- frame -->
						</div><!-- shadow -->
						
						<!-- meta info bar -->
						<div class="bar">
							<div class="bar-frame clearfix">
								<div class="date">
									<strong class="day">16</strong>
									<div class="holder">
										<span class="month">Jan</span>
										<span class="year">2014</span>
									</div>
								</div>
								<div class="author">
									<strong class="title">AUTHOR</strong>
									WiFeng								</div>
								<div class="categories">
									<strong class="title">CATEGORY</strong>
									<span><a href="http://521-wf.com/category/cpp/">C/C++</a>,<a href="http://521-wf.com/category/web/">Web</a></span>
								</div>
								<div class="comments">
									<strong class="title">COMMENTS</strong>
									<a href="http://521-wf.com/archives/241.html#comments">No Comments</a>
								</div>								
							  	
							  								  	
							  								</div><!-- bar frame -->
						</div><!-- bar -->
					</div><!-- box -->
					<div style="clear: both;"> </div>
					<div id="comments">
                        
                        <div id="respond-post-241" class="respond">
            
            <div class="cancel-comment-reply">
            <a id="cancel-comment-reply-link" href="http://521-wf.com/archives/241.html#respond-post-241" rel="nofollow" style="display:none" onclick="return TypechoComment.cancelReply();">取消回复</a>            </div>
            
			<h4 id="response">添加新评论 &raquo;</h4>
			<form method="post" action="http://521-wf.com/archives/241.html/comment" id="comment_form">
                				<p>
                    <label for="author">称呼<span class="required">*</span></label>
					<input type="text" name="author" id="author" class="text" size="15" value="" />
				</p>
				<p>
                    <label for="mail">电子邮件<span class="required">*</span></label>
					<input type="text" name="mail" id="mail" class="text" size="15" value="" />
				</p>
				<p>
                    <label for="url">网站</label>
					<input type="text" name="url" id="url" class="text" size="15" value="" />
				</p>
                				<p><textarea rows="5" cols="50" name="text" class="textarea"></textarea></p>
				<p>
					<label for="seccode">请输入验证码<span class="required">*</span></label>
					<input type="text" name="seccode" id="seccode" class="text" size="10" value="" />&nbsp;&nbsp;&nbsp;<img  src="http://521-wf.com/action/seccode-show?r=1" style="cursor:pointer;vertical-align:middle" title="点击刷新验证码" alt="点击刷新验证码"  onclick="this.src=this.src+1" />				</p>
				<p><input type="submit" value="提交评论" class="submit" /></p>

			</form>
            </div>
            		</div>
				</div>

	<div class="push"></div>
<!-- end #content-->

	</div>
	<div id="footer">
			<div class="frame">
				<div class="bar">
					<p class="copyright">&copy; 2013 <a href="http://521-wf.com/">WiFeng的博客</a>&nbsp;&nbsp;<a href="http://www.miitbeian.gov.cn/" target="_blank" >京ICP备11010442号-1</a> </p>
					<div class="menu-topmenu-container"><ul class="footernav" id="menu-footer">
					<li><a href="http://521-wf.com/">首页</a></li>
            <li><a href="http://521-wf.com/31.htm" title="知识集锦">知识集锦</a></li>
        <li><a href="http://521-wf.com/about.htm" title="关于博主">关于博主</a></li>
        <li><a href="http://521-wf.com/friendlylink.htm" title="友情链接">友情链接</a></li>
        <li><a href="http://521-wf.com/feed" class="rssfeed" target="_blank">RSS</a></li>
</ul></div>				</div><!--bar-->
			</div><!--frame-->
		</div>

</div>

<script src="http://521-wf.com/action/timelynotice-send"></script>
<link rel="stylesheet" href="http://521-wf.com/usr/plugins/KindEditor/editor/plugins/code/prettify.css?v=2.2" />
<script charset="utf-8" src="http://521-wf.com/usr/plugins/KindEditor/editor/plugins/code/prettify.js?v=2.2"></script>
<script type="text/javascript">
if(document.all) {
	window.attachEvent('onload', function(){
	prettyPrint();
});
} else {
	window.addEventListener('load', function(){
	prettyPrint();
});  
}
</script>
<script src="http://521-wf.com/usr/themes/Dispatch/includes/js/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type='text/javascript' src='http://521-wf.com/usr/themes/Dispatch/includes/js/jquery.sticky.js?ver=3.1.1'></script>
<script type="text/javascript">
 <!--
var J = jQuery.noConflict();

J(document).ready(function(){
					
	// Drop Menu
	function mainmenu(){
	J(".nav ul ").css({display: "none"}); // Opera Fix
	J(".nav li").hover(function(){
			J(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown(200);
			},function(){
			J(this).find('ul:first').css({visibility: "hidden"});
			});
	}
		
	mainmenu();
	
	// Fade Icons
	J("img.a").hover(
		function() {
		J(this).stop().animate({"opacity": "0"}, "fast");
		},
		function() {
		J(this).stop().animate({"opacity": "1"}, "fast");
	});
	
	// Fade Hover Links
	J(".entry-title a").hover(
	function() {
		J(this).animate({"opacity": ".7"}, "fast");
			},
		function() {
			J(this).animate({"opacity": "1"}, "fast");
	});
	
	// Remove Margins
	J('#sidebar > div').last().addClass('last-sidebar');
	
	// Sticky Sidebar
	J('#sticky > div').last().addClass('last-sidebar');
	J("#sticky").sticky({topSpacing:90,className:'sticky'});
});
 //-->
</script>

<script type="text/javascript">
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fde1f431ae9f33ce347ed88bb22c58e71' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-29580413-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>

<!-- Baidu Button BEGIN -->
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"slide":{"type":"slide","bdImg":"6","bdPos":"right","bdTop":"60.5"},"image":{"viewList":["qzone","tsina","tqq","renren","weixin"],"viewText":"分享到：","viewSize":"16"},"selectShare":{"bdContainerClass":null,"bdSelectMiniList":["qzone","tsina","tqq","renren","weixin"]}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
<!-- Baidu Button END -->

</body>
</html>	
